import { request } from '@/utils/request';
import Api from '@/core/permission/modules/ruleengine/meterModel';


export function getMeterModelList(query?: API.PageParams) {
  return request<API.ModelListResultItem>({
    url: Api.list,
    method: 'get',
    params: query,
  });
}

export function addModel(data: API.CreateMeterModelParams) {
  return request(
    {
      url: Api.add,
      method: 'post',
      data,
    },
    {
      successMsg: '保存成功',
    },
  );
}

export function updateModel(data: API.UpdateMeterModelParams) {
  return request(
    {
      url: Api.update,
      method: 'post',
      data,
    },
    {
      successMsg: '更新成功',
    },
  );
}

export function deleteModel(data: API.ModelListResultItem) {
  return request(
    {
      url: 'meter/meterModel/delete',
      method: 'delete',
      data,
    },
    {
      successMsg: '删除成功',
    },
  );
}


